1. Field of the Invention
The present invention relates to an image processing apparatus for executing processing to render a three-dimensional model in virtual space and to a method of controlling this apparatus.
2. Description of the Related Art
Rendering techniques whereby three-dimensional virtual space that has been constructed within a computer is generated as a realistic image of the kind captured by a camera are known in the art. One of these rendering techniques is a shadow-casting technique for rendering a virtual shadow of a virtual object, which is illuminated by a virtual light source within virtual space, in order to express a light environment that is closer to reality. Although there are various methods of practicing the shadow-casting technique, the stencil shadow method and depth buffer method are available as techniques that afford a higher degree of realism. These techniques both necessitate two-stage rendering processing referred to as “two-pass rendering”. For example, the first and second stages in the case of the depth buffer method are as follows:                First stage: find an area that becomes a shadow when a virtual object is viewed from a virtual light source.        Second stage: perform shadow casting by mapping the area of the shadow, which has been obtained in the first stage, when an image as viewed from the camera viewpoint is generated.        
On the other hand, there is a collision check technique for checking whether virtual objects are contacting each other in three-dimensional virtual space constructed within a computer. For example, in the case of a simulation game that uses the collision check technique, contact between the character of a player and an obstacle can be determined, thereby enabling the character to avoid penetrating the obstacle. Information relating to collision check is described in “Collision Detection in Interactive 3D Environments” (by Gino Van Den Bergen, Morgan Kaufmann Pub; ISBN: 155860801X).
Generally, processing is divided into two stages, namely interference detection and collision detection, in the collision check as well. Interference detection refers to processing for determining whether virtual objects in virtual space are overlapping each other, that is, processing for determining, at high speed, whether there is a possibility that virtual objects are interfering with each other. Collision detection refers to processing, which is applied to a pair of virtual objects for which the possibility of interference has been determined from the results of interference detection, for determining in greater detail whether the shapes of the virtual objects are interfering with each other.
However, both shadow-casting processing and the collision check technique involve a large computation load. With regard to shadow-casting processing, there are various methods of performing shadow casting in virtual space. Basically, however, regardless of the method, if the shape of a shadow or precision such as grain is sought, then the computation load increases correspondingly. For example, when highly realistic shadow casting is performed, as mentioned above, two-pass rendering generally is carried out. With a method that carries out two-pass rendering, rendering is literally performed two times. The result is increased computation load.
Further, in relation to the collision check technique, if virtual space is simulated with accompanying execution of collision check processing, the most common situation is one in which a number of virtual objects that move dynamically in virtual space exist and the collision check is performed with regard to each of these virtual objects. Furthermore, there are many cases where a virtual object in virtual space is given a complicated shape (often polygonal) in order to express realism in virtual space to the maximum extent. An enormous computation load is required in order to perform the collision check under these conditions.
In a case where a shadow-casting function and collision check function are used conjointly in virtual space rendering processing, it is difficult for these to be computationally executed in real-time for the reasons set forth above.